-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Dafny server API for counterexamples #5847
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you update some of the counterexample LSP tests as well, so they look at the newly introduced field? Letting all the tests look at Variables
instead of Assumptions
would be OK.
@@ -4,12 +4,14 @@ | |||
namespace Microsoft.Dafny.LanguageServer.Handlers.Custom { | |||
public class CounterExampleItem { | |||
public Position Position { get; } | |||
public IDictionary<string, string> Variables { get; } | |||
|
|||
public string Assumption { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you intend the Assumption
field to be used by the IDE? Otherwise better not to have it and reduce bandwidth.
I brought back the old tests, the ones that test |
@keyboardDrummer would you know how to fix the tests? |
@keyboardDrummer @MikaelMayer The old tests use an entirely different interface, so they won't help at all. The way to go is to edit existing tests manually one by one. I can do this but it might take me a few days. |
Description
Fixes dafny-lang/ide-vscode#492
The language sever currently crushes when asking to display counterexamples. This is because #5013 changed the way counterexamples are represented but the IDE still expects the old representation. This PR fixes this. The IDE will now display any constraints that equate some literal to a variable/field/function application, etc. Here are some examples:
How has this been tested?
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.